//        https://ac.nowcoder.com/acm/problem/260770






#include <iostream>
#include <string>

using namespace std;

int n, l, r;
string s;

long long find(int x, string s)
{
    if (x == 0)
        return 0;

    int left = 0, right = 0;
    int hash[26] = { 0 }, kinds = 0;
    long long ans = 0;

    while (right < n)
    {
        if (hash[s[right] - 'a']++ == 0) kinds++;
        while (kinds > x)
        {
            if (hash[s[left] - 'a']-- == 1) kinds--;
            left++;
        }
        ans += right - left + 1;
        right++;
    }

    return ans;
}

int main()
{
    cin >> n >> l >> r >> s;

    cout << find(r, s) - find(l - 1, s) << endl;

    return 0;
}